#ifndef CHECKERSBOARD_H
#define CHECKERSBOARD_H

#include <vector>
#include "CheckersConstants.h"
#include "CheckersMove.h"

using namespace std;

class CheckersBoard
{
    public:
        CheckersBoard();
        ~CheckersBoard();
        CheckersBoard(const CheckersBoard& other);
        CheckersBoard& operator=(const CheckersBoard& other);

        vector< vector <int> > getBoard() { return board; }
        vector<int> getRow(int pRow);
        int pieceAt(int pRow, int pCol);

        void initializeBoard();
        bool isInside(int pRow, int pCol);
        bool canMove(int player, int pFromRow, int pFromCol, int pToRow, int pToCol);
        bool canJump(int player, int pFromRow, int pFromCol, int pEnemyRow, int pEnemyCol, int pToRow, int pToCol);
        void calculateLegalMoves(int player); //get the board legal moves of player, feasible function
        void movePiece(CheckersMove* pMove); //actually move the piece
        void calculateLegalJumps(int player, int pRow, int pCol);
        //nyari lompat setelah lompat, hanya dipanggil kalo ngejalanin gereakan yg isJump() == true

        void printBoard();
        void printLegalMoves();
        vector<CheckersMove*> getLegalMoves() { return legalMoves; }
    protected:
    private:
        vector< vector <int> > board;
        vector<CheckersMove*> legalMoves;
};

#endif // CHECKERSBOARD_H
